package com.indicator.client.bean;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public final class IndicatorApplicationContext {

    /***要替换成cache**/
    private   final Map<String,IndicatorCommand> commandMap=new ConcurrentHashMap<>();

    private static final IndicatorApplicationContext indicatorApplicationContext=new IndicatorApplicationContext();
    public static IndicatorApplicationContext getInstance(){
        return indicatorApplicationContext;
    }

    public void put(String key,IndicatorCommand command){
        commandMap.put(key,command);
    }

    public IndicatorCommand get(String key){
        return commandMap.get(key);
    }

    public IndicatorAdapter defaultComputeAdapter(){
       return new IndicatorAdapter(new IndicatorCommandComputer(),new DefaultIndicatorManager());
    }






}
